//
//  PublicForgetPwdApi.m
//  3DPrint
//
//  Created by Fidetro on 2016/12/31.
//  Copyright © 2016年 Fidetro. All rights reserved.
//

#import "PublicForgetPwdApi.h"

@implementation PublicForgetPwdApi
{
    NSDictionary *_dic;
}

-(instancetype)initWithDic:(NSDictionary *)dic{
    if (self = [super init]) {
        _dic = dic;
    }
    return self;
}

- (NSString *)requestUrl {
    return @"/new/user/reset_pwd";
}

- (YTKRequestMethod)requestMethod {
    return YTKRequestMethodPOST;
}

- (id)requestArgument {
    
    NSMutableDictionary *dic = [NSMutableDictionary getPubdicGuest];
    if (_dic[@"username"]) {
        
        NSString* base64Text = [NSString encryptUseAES:_dic[@"username"] key:nil];
        
        [dic setObject:base64Text forKey:@"username"];
        
    }
    if (_dic[@"password"]) {
        NSString* base64Text = [NSString encryptUseAES:_dic[@"password"] key:nil];
        
        [dic setObject:base64Text forKey:@"password"];
        
    }
    if (_dic[@"vcode"]) {
        [dic setObject:_dic[@"vcode"] forKey:@"vcode"];
        
    }
    NSString *sign=[NSString getSign:dic];
    [dic setObject:sign forKey:@"sign"];
    
    return dic;
}
@end
